Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage: Split out MC/DC mappings from BcbMappingKind #124603

Merged
merged 5 commits into from
May 5, 2024

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented May 2, 2024

These variants were added to BcbMappingKind as part of the MC/DC coverage implementation in #123409, because that was the path-of-least-resistance for integrating them into the existing code.

However, they ultimately represent complex concepts that the enum was not intended to handle, leading to more complexity in the code that processes them. This PR therefore follows in the footsteps of #124545, and splits the MC/DC mappings out into their own dedicated vectors of structs.

After that, BcbMappingKind itself ends up having only one variant (Code), so this PR also flattens that enum into its enclosing struct, renamed to mapping::CodeMapping.


No functional changes.

This will conflict slightly with #124571, but hopefully that should be easy to resolve either way.

@rustbot label +A-code-coverage

@rustbot
Copy link
Collaborator

rustbot commented May 2, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 2, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 2, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label May 2, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 3, 2024

☔ The latest upstream changes (presumably #124675) made this pull request unmergeable. Please resolve the merge conflicts.

Now that branch and MC/DC mappings have been split out into separate types and
vectors, this enum is no longer needed, since it only represents ordinary
"code" regions.

(We can revisit this decision if we ever add support for other region kinds,
such as skipped regions or expansion regions. But at that point, we might just
add new structs/vectors for those kinds as well.)
This makes it consistent with the other mapping structs introduced by this PR.
Copy link
Member

@Nadrieril Nadrieril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Many thanks for the small commits, they made reviewing straightforward.

@Nadrieril
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 5, 2024

📌 Commit 6968123 has been approved by Nadrieril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 5, 2024

🌲 The tree is currently closed for pull requests below priority 9999. This pull request will be tested once the tree is reopened.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 5, 2024
@bors
Copy link
Contributor

bors commented May 5, 2024

⌛ Testing commit 6968123 with merge 9c9b568...

@bors
Copy link
Contributor

bors commented May 5, 2024

☀️ Test successful - checks-actions
Approved by: Nadrieril
Pushing 9c9b568 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 5, 2024
@bors bors merged commit 9c9b568 into rust-lang:master May 5, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 5, 2024
@Zalathar Zalathar deleted the mcdc-mappings branch May 5, 2024 23:26
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9c9b568): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 675.62s -> 676.55s (0.14%)
Artifact size: 315.94 MiB -> 315.72 MiB (-0.07%)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 10, 2024
…idtwco

coverage: Further simplify extraction of mapping info from MIR

This is another round of rearrangement and simplification that builds on top of the changes made to mapping-extraction by rust-lang#124603.

The overall theme is to take the computation of `bcb_has_mappings` and `test_vector_bitmap_bytes` out of the main body of `generate_coverage_spans`, which then lets us perform a few other small changes that had previously been held up by the need to work around those computations.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 10, 2024
…idtwco

coverage: Further simplify extraction of mapping info from MIR

This is another round of rearrangement and simplification that builds on top of the changes made to mapping-extraction by rust-lang#124603.

The overall theme is to take the computation of `bcb_has_mappings` and `test_vector_bitmap_bytes` out of the main body of `generate_coverage_spans`, which then lets us perform a few other small changes that had previously been held up by the need to work around those computations.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2024
Rollup merge of rust-lang#124615 - Zalathar:extracted-mappings, r=davidtwco

coverage: Further simplify extraction of mapping info from MIR

This is another round of rearrangement and simplification that builds on top of the changes made to mapping-extraction by rust-lang#124603.

The overall theme is to take the computation of `bcb_has_mappings` and `test_vector_bitmap_bytes` out of the main body of `generate_coverage_spans`, which then lets us perform a few other small changes that had previously been held up by the need to work around those computations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants